﻿using System.Windows.Forms;
using SharpDNDTools.UserControls.Core;

namespace SharpDNDTools.Forms
{
    public partial class frmMainForm : Form
    {
        private readonly TreeNode tnAlignment = new TreeNode("Alignment");
        private readonly TreeNode tnClass = new TreeNode("Class");
        private readonly TreeNode tnCoreDefinition = new TreeNode("Core Definitions");
        private readonly TreeNode tnFeat = new TreeNode("Feat");
        private readonly TreeNode tnItem = new TreeNode("Item");
        private readonly TreeNode tnRace = new TreeNode("Race");
        private readonly TreeNode tnSkill = new TreeNode("Skill");
        private readonly TreeNode tnSpell = new TreeNode("Spell");

        public frmMainForm()
        {
            InitializeComponent();
            BuildAdminTree();
        }

        private void BuildAdminTree()
        {
            tnCoreDefinition.Nodes.AddRange(new[] {tnAlignment, tnRace, tnClass, tnSkill, tnSpell, tnFeat, tnItem});
            tnCoreDefinition.Expand();

            tvAdmin.Nodes.Add(tnCoreDefinition);
        }

        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Node == tnAlignment)
            {
                ucViewAlignments viewAlignments = new ucViewAlignments();
                viewAlignments.Dock = DockStyle.Fill;
                splitContainer1.Panel2.Controls.Clear();
                splitContainer1.Panel2.Controls.Add(viewAlignments);
            }
            else if (e.Node == tnRace)
            {
            }
            else if (e.Node == tnClass)
            {
            }
            else if (e.Node == tnSkill)
            {
            }
            else if (e.Node == tnSpell)
            {
            }
            else if (e.Node == tnFeat)
            {
            }
            else if (e.Node == tnItem)
            {
            }
        }
    }
}